#ifndef hppship
#define hppship

#include "common.hpp"

class tile;
class item;
class room;
class subsys;

class ship : public sf::Drawable
{
private:
	int roomID;
	size_t w;
	size_t h;
	std::vector<tile> tileMap;
	sf::VertexArray   vertMap;
	std::shared_ptr<sf::Texture> vertTex;
	std::vector<std::shared_ptr<room>>   roomList;
	std::vector<std::shared_ptr<subsys>> sysList;
	itemPriorList itemList;

    void draw(sf::RenderTarget& target, sf::RenderStates states) const;


public:
	std::vector<int>  pathMap; // temporarily public until I can be bothered to do something sensible
	std::shared_ptr<room> roomOut;

	ship(size_t inw, size_t inh);

	bool isVoid(sf::Vector2f loc);

	void refreshDisp();

	void tick(float timeStep);

	std::string toString();

    void makeRoom(size_t i, size_t j);

    void floodRoom(size_t i, size_t j, std::shared_ptr<room>);

	tile * getTile(size_t i, size_t j);
	tile * getTile(sf::Vector2f loc);

	void setTile(size_t i, size_t j, tile intile);

	void setTex(std::shared_ptr<sf::Texture> intex);
};

#endif // hppship
